package usersOnlineDao

import (
	"chart.zozoo.net/app/models"
	"chart.zozoo.net/core/mysql"
)

// Info 获取用户在线数据
func Info(uuid string) (u *models.UserOnline, err error) {
	u = &models.UserOnline{}
	row := mysql.MysqlClient.
		Select("id", "host", "addr", "status", "login_at", "logout_at").
		Where("uuid = ?", uuid).
		First(u)
	if row.Error != nil {
		return nil, row.Error
	}

	return u, nil
}
